feat(frameworks): wire stage-5 import/SCIP detection into the profile phase#267
Merged
Merged
Conversation
… phase Stage 5 (imports.ts: detect frameworks from IMPORTS edges to external-module stubs) shipped as a tested standalone module but reached no detection — the profile phase ran at deps:[scan], before the parse phase emits IMPORTS edges, so there was no graph to read. The DAG-ordering decision: profile now deps [scan, parse]. parse deps [scan, structure] and neither deps profile, so no cycle; profile's own consumers (dependencies / repo-node / scip-index) only read its output and are unaffected by it running later. The parse phase emits the external-stub IMPORTS edges stage 5 needs (parse.ts), so they're present by detection time — no need to wait for crossFile (which only resolves the in-repo IMPORTS edges). Wiring: - profile passes ctx.graph as `importGraph` to detectFrameworksDetailed; KnowledgeGraph structurally satisfies the stage's edges()/getNode() reader. - FrameworkDetectionInput + FrameworkDetectorInput gain optional `importGraph`; the dispatcher runs detectFromImports once, groups by framework, and merges as stage-5 evidence. A `deterministic` (scip-resolved, confidence 1.0) import CREATES a detection on its own — an `import fastapi` is as authoritative as a manifest dep, and inferConfidence treats it as deterministic; a `heuristic` import only corroborates a hit from another stage. - Legacy callers that omit `importGraph` are unaffected (no-op). Updated the orchestrator phase-order test for the new topological order (profile + its dependents now follow parse/complexity/orm) — captured from a real run, not hand-derived. Tests: 4 new detector stage-5 cases (deterministic-creates, heuristic-doesn't, heuristic-corroborates, omitted-no-op). frameworks 96 + ingestion 638 green; full workspace 0 fail; biome ci + typecheck clean. Note: like the symbol-enrichment work, a live-analyze e2e of stage 5 wasn't possible in this sandbox (WASM parse emits no external-import stubs without the scip indexers); covered at the unit level with an ImportStageGraph fixture.
Merged
theagenticguy
pushed a commit
that referenced
this pull request
Jun 30, 2026
🤖 Automated release via release-please --- <details><summary>root: 0.10.5</summary> ## [0.10.5](root-v0.10.4...root-v0.10.5) (2026-06-30) ### Features * **eval:** pack --variance-probe — measure the variance an OCH pack removes (Move 2) ([#269](#269)) ([278702a](278702a)) * **frameworks:** wire stage-5 import/SCIP detection into the profile phase ([#267](#267)) ([6b4d122](6b4d122)) * **pack:** codehub replay — decision-equivalence structural check (Move 6) ([#270](#270)) ([f97b417](f97b417)) </details> <details><summary>cli: 0.10.5</summary> ## [0.10.5](cli-v0.10.4...cli-v0.10.5) (2026-06-30) ### Features * **eval:** pack --variance-probe — measure the variance an OCH pack removes (Move 2) ([#269](#269)) ([278702a](278702a)) * **pack:** codehub replay — decision-equivalence structural check (Move 6) ([#270](#270)) ([f97b417](f97b417)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires framework-detection stage 5 (import/SCIP) into production — the last deferred detection stage.
detectFromImports(frameworks fromIMPORTSedges to external-module stubs) shipped tested but reached nothing, because the profile phase ran atdeps: [scan], before the parse phase emits those edges.The DAG-ordering decision
profilenow depends on[scan, parse].parsedeps[scan, structure], neither of which depends onprofile→ no cycle. The parse phase emits the external-stubIMPORTSedges stage 5 reads, so they exist by detection time — no need to wait forcrossFile(which only resolves in-repo import edges). Profile's consumers (dependencies/repo-node/scip-index) only read its output and are unaffected by it running later.Wiring
profilepassesctx.graphasimportGraphtodetectFrameworksDetailed;KnowledgeGraphstructurally satisfies the stage'sedges()/getNode()reader.FrameworkDetectionInput+FrameworkDetectorInputgain optionalimportGraph; the dispatcher runsdetectFromImportsonce, groups by framework, merges as stage-5 evidence.deterministicimport (scip-resolved, confidence 1.0) creates a detection on its own — animport fastapiis as authoritative as a manifest dep (inferConfidencetreats it asdeterministic). Aheuristicimport only corroborates a hit from another stage.importGraphare a no-op.Tests / validation
biome ci+ typecheck clean.Honest e2e note
A live
analyzecouldn't exercise stage 5 in my sandbox (the WASM parse emits no external-import stubs without the scip indexers installed). Covered at the unit level with anImportStageGraphfixture; the wiring path runs on real indexers in CI's matrix.This closes the last framework-detection stage and the last item from the M-W-F roadmap follow-ups.
🤖 Generated with Claude Code